package interview;

public class Main2 {
    public static void main(String[] args) {
        String[] ss = reverse("i love llepppo");
        for (String s : ss) {
            System.out.print(s + " ");
        }
    }
    public static  String[] reverse(String s){
        String[] str = s.split(" ");
        for (int i = 0; i < str.length; i++) {
            if(str[i].length() >= 5){
                char[] ch = str[i].toCharArray();
                for (int j = 0, k = ch.length - 1; j < ch.length / 2; j++, k--) {
                    char c = ch[j];
                    ch[j] = ch[k];
                    ch[k] =c;
                }
                str[i] = String.valueOf(ch);
            }
        }
        return str;
    }
}
